function showQueryBox(strid, events){
	if(!events){events='';}
	document.write('<input type="text" style="width:50px;background-color:yellow;color:#333;" name="' + strid + 'Query" id="' + strid + 'Query" onkeypress="queryBoxEnterPress(\'' + strid + '\',\'' + events + '\',event)"/>&nbsp;<img src="' + baseUrl + '/image/detail.png" style="cursor:hand;height:25px;border:0px" onclick="queryCombo(\'' + strid + '\', \'' + events + '\')" alt="查询" title="查询"/><input type="hidden" id="' + strid + 'CurrentIdx" value="0"/>');
}
function queryBoxEnterPress(strid, events, e){
	var e = e || window.event;
	if(e.keyCode == 13){
		queryCombo(strid,events);
	}
	try{
		e.stopPropagation();
	}catch(e){}
}
function queryCombo(strid, events){
		var inst = document.getElementById(strid);
		var currentIdx = document.getElementById(strid + "CurrentIdx");
		var idx = parseInt(currentIdx.value);
		if(idx !=0) idx=idx+1;
		var key = document.getElementById(strid + "Query").value;
		if(key == ""){
			alert("请输入要查询的关键字");
			return;
		}
		var i=0;
		if(idx>inst.options.length){
			idx=0;
		}
		for(i=idx;i<inst.options.length;i++){
			if(inst.options[i].innerHTML.indexOf(key) != -1){
				idx = i;
				inst.options[i].click();
				break;
			}
		}
		if(i == inst.options.length){
			alert("已查询到最后一条记录，请重新查询！");
			inst.selectedIndex = 0;
			currentIdx.value=0;
		}else{
			inst.selectedIndex = idx;
			currentIdx.value=idx;
		}
		if(events != "undefined" && events != ''){
			eval(events);
		}
	}